import request from '@/utils/request';



// 登录接口
export const userLoginService = ({ userName, password }) => {
  return request.post('/login', { userName, password });
}

// 获取用户基本信息
export const userGetInfoService = () => {
  return request.get('/users/profile');
};

//只获取学工号和真名
export const getUserBasicInfoService = () => {
  return request.get('/users/basicInfo');
};
// 更新用户密码
export const userUpdatePasswordService = ({ oldPassword, newPassword, confirmPassword }) => {
  return request.put('/users/password', { oldPassword, newPassword, confirmPassword });
}
//重置密码更新接口
export const userResetPasswordService = (resetData) => {
  return request.put('/users/resetPassword', resetData);
};

// 测试接口
export const testServiceApi = (str) => {
  return request.get('/testSE', {
    params: {
      str
    }
  });
};


// 更新用户安全信息
export const updateUserSecurityInfoService = (updateDTO) => {
  return request.put('/users/securityInfo', {
    newPhone: updateDTO.phone,
    newEmail: updateDTO.email,
  });
};

